﻿<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" href="/wwwroot/common/css/sapar.css?v=@FileServer.Common.VersionNo.VNo" />
    <link rel="stylesheet" type="text/css" href="/wwwroot/common/css/common.css?v=@FileServer.Common.VersionNo.VNo" />
    <link rel="stylesheet" type="text/css" href="/wwwroot/common/css/jquery-ui.css" />
    <script type="text/javascript" src="/wwwroot/common/js/jquery-1.12.4.js"></script>
    <script type="text/javascript" src="/wwwroot/common/js/jquery-ui.js"></script>
    <script type="text/javascript" src="/wwwroot/common/js/dialog.js?v=@FileServer.Common.VersionNo.VNo"></script>
    <script src="/wwwroot/My97DatePicker-4.72/WdatePicker.js"></script>
    <script src="/wwwroot/common/js/SelectAll.js?v=@FileServer.Common.VersionNo.VNo"></script>
    <script src="/wwwroot/common/js/SelectTr.js?v=@FileServer.Common.VersionNo.VNo"></script>
    <link href="/wwwroot/common/css/Page.css?v=@FileServer.Common.VersionNo.VNo" rel="stylesheet" />
    <link href="/wwwroot/common/css/cloudDrive.css" rel="stylesheet" />
    <link rel="stylesheet" href="/wwwroot/common/js/skin/layer.css" />
    <title>系统信息</title>
   
</head>
<body class="bg-light">
    <style>
        .dtitle {
            font-size: 18px;
            font-weight: bold;
            margin-top: 30px;
            text-align: center;
            color:dodgerblue
        }

        .dnum {
            font-size: 16px;
            margin-top: 10px;
            text-align: center;
            color:red;
        }

        .dinfo {
            float: left;
            width: 160px;
            height: 130px;
            background-color: whitesmoke;
            margin-right: 50px;
            border-radius: 10px;
            margin-top:20px;
        }
    </style>

    <div id="saper-container">
        <form id="searchForm" name="searchForm" action="" method="post">
            <div id="saper-hd"></div>
            <div id="saper-bd">
                <div class="subfiled clearfix">
                    <h2>系统状态</h2>
                </div>
                <div class="subfiled-content">
                    <div class="search-box clearfix">
                    </div>


                </div>
            </div>
        </form>


    </div>
    <div style="width:700px;margin:0px auto;">
        <div class="dinfo">
            <div class="dtitle">我的空间占用</div>
        <div class="dnum" id="getPersonFileServerDirSize_div"></div>
        </div>
        <div class="dinfo">
            <div class="dtitle">文件数量</div>
        <div class="dnum" id="getPersonFileCount_div"></div>
        </div>
        <div class="dinfo">
            <div class="dtitle">剩余空间</div>
        <div class="dnum" id="deviceOnLineCount">100 G</div>
        </div>
      
    </div>
  <div style="height:100px;clear:both"></div>
    <div style="margin:0px auto;width:361px;"><img src="\wwwroot\images\cloudDrive\drive.png" /></div>


    <script>
        function getPersonFileServerDirSize() {
            const urlParams = new URLSearchParams(window.location.search);
       
            const token = localStorage.getItem('token');
           
            $.ajax({
                url: 'http://localhost:8060/api/system/getPersonFileServerDirSize',
                method: 'POST',
                headers: {
                    'Authorization': `Bearer ${token}`
                },
                data: {
                  
                },
                success: function (response) {
                    $("#getPersonFileServerDirSize_div").text(response.data.totalFileSize);
                    $("#getPersonFileCount_div").text(response.data.totalFileCount);
                     
                },
                error: function (xhr) {
                    console.error('API request failed:', xhr);
                    alert('获取信息失败：' + (xhr.responseJSON?.message || xhr.statusText));
                }
            });
        }

          // Initial load
          $(document).ready(function () {
            getPersonFileServerDirSize();
                                });
    </script>
</body>
</html>
